package org.xxpay.core.common.domain.api;

import org.xxpay.core.common.constant.MchConstant;
import org.xxpay.core.entity.MchAccount;

/**
 * 代付余额查询接口api 实体Bean
 */
public class AgentpayBalanceRes extends AbstractRes {

    /**  **/
    private String agentpayBalance;

    /**  **/
    private String availableAgentpayBalance;

    public String getAgentpayBalance() {
        return agentpayBalance;
    }

    public void setAgentpayBalance(String agentpayBalance) {
        this.agentpayBalance = agentpayBalance;
    }

    public String getAvailableAgentpayBalance() {
        return availableAgentpayBalance;
    }

    public void setAvailableAgentpayBalance(String availableAgentpayBalance) {
        this.availableAgentpayBalance = availableAgentpayBalance;
    }

    public void setByMchAccount(MchAccount mchAccount, Byte subAmountFrom){
        if(MchConstant.AGENTPAY_OUT_ACCOUNT_BALANCE == subAmountFrom) { // 1 普通收款账户
            this.agentpayBalance = mchAccount.getBalance() + "";                    // 账户余额
            this.availableAgentpayBalance = mchAccount.getAvailableBalance() + "";  // 可用账户余额
        }else if(MchConstant.AGENTPAY_OUT_ACCOUNT_AGBALANCE == subAmountFrom) { // 2 代付账户
            this.agentpayBalance = mchAccount.getAgentpayBalance() + "";                    // 代付余额
            this.availableAgentpayBalance = mchAccount.getAvailableAgentpayBalance() + "";  // 可用代付余额
        }
    }


}


